<?php

namespace Api\Controller;

use Think\Controller;

//加载commons下的functions.php自定义函数库
load("@.functions");

/**
 * Description of NewsApiController
 *
 * @author Administrator
 */
class NewsApiController extends Controller {

    //put your code here
    function get_news() {
        header("Content-Type: text/html; charset=utf-8");
        verify_app_key(I('get.app_key'));
        $result['code'] = "200";d
        $id = I('get.id');
        //echo $id;
        /*
        if (!is_int($id)) {
            $result['code'] = "1020101";
            echo json_encode($result, JSON_PRETTY_PRINT);
            die();
//            echo "请输入正确的ID";
        }
        */
        $NewsModel = new \Common\Model\NewsModel();
        $news = $NewsModel->find($id);
        $result['result'] = $news;
        echo json_encode($result, JSON_PRETTY_PRINT);
    }
    
    function get_list(){
        
    }

}
